export function isMac() {
  return navigator.userAgent.toLowerCase().indexOf('mac') > -1
}

export function isWin() {
  return navigator.platform
}

export const getOSname = () => {
  let e = 'Unknown'
  if (window.navigator.userAgent.indexOf('Windows NT 10.0') != -1) e = 'Windows 10'
  if (window.navigator.userAgent.indexOf('Windows NT 6.2') != -1) e = 'Windows 8'
  if (window.navigator.userAgent.indexOf('Windows NT 6.1') != -1) e = 'Windows 7'
  if (window.navigator.userAgent.indexOf('Windows NT 6.0') != -1) e = 'Windows Vista'
  if (window.navigator.userAgent.indexOf('Windows NT 5.1') != -1) e = 'Windows XP'
  if (window.navigator.userAgent.indexOf('Windows NT 5.0') != -1) e = 'Windows 2000'
  if (window.navigator.userAgent.indexOf('Mac') != -1) e = 'Mac/iOS'
  if (window.navigator.userAgent.indexOf('X11') != -1) e = 'UNIX'
  if (window.navigator.userAgent.indexOf('Linux') != -1) e = 'Linux'
  return e
}
